<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj = {
            name: "eric",
            age: 100,
            sex: 'man',
            eat: function(){

            }
        }

        Object.myKeys = function() {
            var result = []
            for (var i in obj){
                result.push(i)
            }
            return result
        }

        console.log(Object.myKeys(obj))
    </script>
</body>
</html>